import { store } from "@/stores"
import { setTimeOutInfo } from "@/stores/global/global.store"

interface ArgsType {
	msg: string
	context: string
}

// 超时限制
export const timeOutFunc = (args?: Partial<ArgsType>) => {
	const isLock = store.getState().global.timeOutInfo.isLock
	if (!isLock) {
		store.dispatch(
			setTimeOutInfo({
				isLock: true,
				...args
			})
		)
	}
}
